<template>
	<view>
		<view class="patient">
			<view class="patient_item" v-for="item,index in patientList" :key="index">
				<view class="patient_item_name">
					{{item.name}}
					<view class="patient_item_name_gx">
						{{item.relation}}
					</view>
				</view>
				<view class="patient_item_sex">
					{{item.sex}} &ensp; {{item.relation}} &ensp; {{item.phone}}
				</view>
			</view>
		</view>
		<view class="foot">
			<u-button text="取消"></u-button>
			<u-button type="primary" @click="goPatient" text="添加就诊人"></u-button>
		</view>
	</view>
</template>

<script>
	import {
		getPatient
	} from '../../utils/api.js'
	export default {
		data() {
			return {
				patientList: []
			};
		},
		methods: {
			goPatient() {
				uni.navigateTo({
					url: '/pages/patient/patient'
				})
			}
		},
		created() {
			getPatient().then(res => {
				console.log(res);
				this.patientList = res.data.data
			})
		}
	}
</script>

<style lang="scss">
	.foot {
		width: 750rpx;
		display: flex;
		position: fixed;
		left: 0;
		bottom: 0;
	}

	.patient {
		width: 750rpx;
		height: 100vh;
		background: #ddd;
	}

	.patient_item {
		width: 750rpx;
		padding: 20rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		background: #fff;
	}

	.patient_item_name {
		display: flex;
		align-items: center;
		font-size: 40rpx;
		font-weight: 500;
		margin-bottom: 40rpx;
	}

	.patient_item_name_gx {
		width: 80rpx;
		text-align: center;
		font-size: 32rpx;
		color: royalblue;
		background: skyblue;
		margin-left: 10rpx;
	}

	.patient_item_sex {
		color: #b4c3d1;
	}
</style>